﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace PNut_Project_Lin
{
    public partial class CheckCarPage : PhoneApplicationPage
    {

        List<checkCar> listcheckcar = new List<checkCar>();

        public CheckCarPage()
        {
            InitializeComponent();

            this.Loaded += new RoutedEventHandler(CheckCarPage_Loaded);
        }

        void CheckCarPage_Loaded(object sender, RoutedEventArgs e)
        {
            //throw new NotImplementedException();
            
            listcheckcar.Add(new checkCar("ยางรถยนต์", "555555555555555555555555555555555555555555", "picture/DSCF7635.jpg", "http://www.mickku.com/battery.mp4"));
            listcheckcar.Add(new checkCar("น้ำกลั่นแบตเตอรี่", "", "picture/bn2.jpg", "http://www.mickku.com/battery.mp4"));
            listcheckcar.Add(new checkCar("น้ำมันเกียร์", "", "picture/SAM-0220.JPG", "http://www.mickku.com/battery.mp4"));
            listcheckcar.Add(new checkCar("น้ำมันเบรค", "", "picture/brake-1.jpg", "http://www.mickku.com/battery.mp4"));
            listcheckcar.Add(new checkCar("เข็มขัดนิรภัย", "", "picture/safety_belt2.jpg", "http://www.mickku.com/battery.mp4"));


            CheckCarListBox.DataContext = listcheckcar;
        }

        private void CheckCarListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/DetailPage.xaml?Name=" + listcheckcar.ElementAt(CheckCarListBox.SelectedIndex).Name + "&Detail=" + listcheckcar.ElementAt(CheckCarListBox.SelectedIndex).Detail + "&img=" + listcheckcar.ElementAt(CheckCarListBox.SelectedIndex).img + "&Link=" + listcheckcar.ElementAt(CheckCarListBox.SelectedIndex).Link, UriKind.Relative));
        }

       
    }
}